home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / dosutils / tsbat50.zip / TSBAT.NWS < prev    next >
Text File  |  1996-09-01  |  42KB  |  760 lines

  1. News on the TSBAT batches package by Timo Salmi in reverse order
  2. ================================================================
  3.  
  4. University of Vaasa, Finland, Linux Pentium garbo.uwasa.fi has a
  5. large collection of Shareware, Freeware and Public Domain PC
  6. programs available by anonymous FTP, WWW (World Wide Web) and mail
  7. server. The file ftp://garbo.uwasa.fi/pc/ts/0news-ts contains news
  8. about the TS-programs in the /pc/ts directory (in reverse order).
  9. This text, which you now have, is an extract from the 0news-ts file
  10. and the Usenet news.
  11.  
  12. ....................................................................
  13. Prof. Timo Salmi   Co-moderator of news:comp.archives.msdos.announce
  14. Moderating at ftp:// & http://garbo.uwasa.fi archives  193.166.120.5
  15. Department of Accounting and Business Finance  ; University of Vaasa
  16. ts@uwasa.fi http://uwasa.fi/~ts BBS 961-3170972; FIN-65101,  Finland
  17. ....................................................................
  18.  
  19. Sun 1-Sep-96: I have updated my collection of batch files, tips and
  20. tricks to be ftp://garbo.uwasa.fi/pc/ts/tsbat50.zip. Added the
  21. following items
  22.  46) How can I test whether a disk is empty or not?
  23.  47) How can I run a different batch depending on the weekday?
  24. Added a batch-only solution to
  25.  39) Getting the file basename.
  26. Added the following new batch files:
  27.  SAMENAME.BAT Display drive's files sorted by name
  28.  SAMESIZE.BAT Display drive's files sorted by size
  29.  
  30. Sun 26-May-96: I have updated by collection of batch files, tips and
  31. tricks to be ftp://garbo.uwasa.fi/pc/ts/tsbat49.zip. Added the
  32. following items
  33.  43) How can I change or remove the disk volume serial number?
  34.  44) How to pause in a batch for a preset number of seconds?
  35.  45) Where can I find a program to compile batches into COMs or EXEs?
  36. Put elm compatible headers in all the items to facilitate the
  37. reading of the advice files with greater variety of tools.
  38.  
  39. Sun 28-Apr-96: Added the following items into BATRICKS.TXT in my
  40. collection of batch files ftp://garbo.uwasa.fi/pc/ts/tsbat48.zip
  41.   41) Getting the last replaceable parameter
  42.   42) Creating an empty file if the file does not already exist
  43. Added to PROMPT.TXT the a option to example how to display the time
  44. with the prompt command.
  45.  
  46. Sat 5-Aug-95: Added to my collection of useful batch files and
  47. tricks a new batch
  48.   "SKIP.BAT Perform commands, skipping files"
  49. because the simple trick of excluding particular files from a
  50. command is so often asked.
  51. Added to BATRICKS.TXT a new item
  52.  40) A batch to put user input into an environment variable
  53. It is the neatest batch programming trick I have ever seen. It
  54. remedies the biggest (alleged) flaw in MS-DOS batch programming,
  55. that is getting user input without any external programs.
  56.   The update is ftp://garbo.uwasa.fi/pc/ts/tsbat47.zip.
  57.  
  58. Mon 30-Jan-95: My collection of useful batch files and tricks
  59. includes the file "DOSTRICK.TXT Assorted MsDos tricks and tips"
  60. which in turn has the item "7) Selected Doskey macro examples". I
  61. have added descriptions and material to that item. Also made some
  62. small additions of text to the file "BATRICKS.TXT Assorted batch
  63. tricks and tips". These are parts of my updated
  64.  garbo.uwasa.fi:/pc/ts/tsbat46a.zip
  65.  A collection of useful batch files and tricks
  66.  
  67. Sun 4-Sep-94: I have a collection of useful batch files and batch
  68. tricks, which I have updated. It is now garbo.uwasa.fi:/pc/pd2/
  69. tsbat46.zip.
  70. Added the following items to DOSTRICK.TXT
  71.  4) Stepping trough config.sys and autoexec.bat command by command.
  72.  5) Getting rid of "Insert diskette for drive B:"
  73.  6) Conditional deleting of files
  74.  7) Selected Doskey macro examples
  75.  
  76. Tue 31-May-94: I have updated my collection of useful batches and
  77. batch tricks. It is now garbo.uwasa.fi:/pc/ts/tsbat45.zip.
  78.  - Added a list of user feedback to the TSBAT.INF file
  79.  - Added item 39) Getting the file basename
  80.  - Added optional batch enhancers:
  81.      BASENAME.EXE Extract file name from full name
  82.      BASEPATH.EXE Extract path name from full name
  83.      BASEXTEN.EXE Extract file extension from name
  84.  - Added
  85.      DOSTRICK.TXT Assorted MsDos tricks and tips
  86.  
  87. Sat 15-Jan-94: I have updated my collection of useful batches and
  88. batch tricks. It is now garbo.uwasa.fi:/pc/ts/tsbat44.zip. Added the
  89. following items to batricks.txt:
  90.  37) Traversing a directory tree
  91. Added an related demonstration batch SWEEP.BAT.
  92.  38) Echoing the redirection symbol
  93. Rewrote and added material to
  94.  24) Redirecting a batch file's output
  95.  30) How to obtain the MsDos version into an environment variable
  96. Updated
  97.  PATH.TXT  "How to beat the 127 byte limit"
  98.  SCANZ.BAT "Scan for viruses (incl. execomp)"
  99.  
  100. Sat 8-May-93: I have updated by collection of useful batches and
  101. batch tricks to be garbo.uwasa.fi:/pc/ts/tsbat43.zip by adding the
  102. following items to batricks.txt.
  103.  31) Finding out the number of regular files on a drive
  104.  32) Augmenting line numbers to a text file
  105.  33) Storing and returning to the original directory (push and pop)
  106.  34) Enticing the current date into an environment variable
  107.  35) Identifying the individual PC
  108.  36) For loop and redirection quirks
  109. I have updated by adding a second method to
  110.  7)  Convert a parameter to uppercase
  111. Also a few minor updates to some of the batches.
  112.  
  113. Tue 2-Mar-93: I have updated by collection of useful batches and
  114. batch tricks to be garbo.uwasa.fi:/pc/ts/tsbat42.zip by adding the
  115. following items to batricks.txt.
  116.  26) A simple trick to "disable" a drive
  117.  27) Sending an escape sequence to the printer
  118.  28) Creating a random string
  119.  29) Finding out the length of a string
  120.  30) How to obtain the MsDos version into an environment variable
  121. Added GFIND.BAT "Combine Garbo index files info". It is a
  122. specialized batch for combining the information from Garbo MsDos FTP
  123. archives file index files INDEX.ZIP, _dir.zip and _file.zip. GFIND
  124. is also available in Unix format as garbo.uwasa.fi:/pc/ts/gfind
  125.  
  126. Sat 30-Jan-93: I have updated by collection of useful batches and
  127. batch tricks.
  128.  Added
  129.   SUBS.BAT        Make current dir a subst drive
  130.  Updated
  131.   BATRICKS.TXT    Assorted batch tricks, plus added
  132.     24. Redirecting a batch file's output
  133.     25. Testing for environment space sufficiency
  134.   PROMPT.TXT      Tips on prompt usages with ansi
  135.  
  136. Sat 19-Dec-92: Update garbo.uwasa.fi:/pc/ts/tsbat40.zip of my
  137. collection of useful batch files and batch tips & tricks. Added
  138.   BDIR.BAT  "Bare list & count of directories"
  139.   HEX.BAT   "Add and subtract hexadecimal values"
  140.   PORTS.BAT "Display port base I/O addresses"
  141. Updated and rewrote
  142.   BATRICKS.TXT "Assorted batch tricks"
  143. Corrected
  144.   COLOR.BAT "Set screen color attributes"
  145. It left on a tmp_ environment value.  It shouldn't have.
  146.  
  147. Mon 26-Oct-92: I have again updated my collection of useful batch
  148. files and batch tricks. It is now garbo.uwasa.fi:/pc/ts/tsbat39.zip.
  149.    Added COLORMAP.BAT "Ansi screen color esc. seq. map". I adapted
  150. the idea from PC Computing October 1992. The difference in my
  151. adaptation is that it displays the escape sequence codes you need to
  152. induce the colors on the map. Furthermore, I do not use any
  153. environment variables.
  154.    Added TOUCH.BAT "Touch a file's datetime stamp". It is quite
  155. amazing the thing one can actually do with bare batch files using
  156. the tricks trade.  TOUCH.BAT is a good example of this.
  157.    Added EDIT.BAT "A truly trivial text editor". Appends text to a
  158. text file from the con device, that is the keyboard.
  159.    Made some enhancements to BATRICKS.TXT "Assorted batch tricks"
  160. and added the following item:
  161.  21) Testing if a file name includes a path
  162.  
  163. Sun 20-Sep-92: I have again updated my collection of useful batch
  164. files and batch tricks. It is now garbo.uwasa.fi:/pc/ts/tsbat38.zip.
  165.    WEEKLY.BAT "Run program(s) once a week" is a new batch in my
  166. collection. If you want to run a program once a week when you reboot
  167. your computer, put
  168.   CALL WEEKLY Weekday YourApplicationName [Param1] [Param2] [...]
  169. in your autoexec.bat file. Only one application, or one set of
  170. applications, can be run on the same weekday with this batch. The
  171. application can be a different one for each weekday.
  172. Examples: CALL WEEKLY Mon YourApplication
  173.           CALL WEEKLY Tue echo Time to back up^G^G^G
  174.           CALL WEEKLY Fri call YourBatchOfManyPrograms
  175. No auxiliary programs outside the normal MsDos commands have been
  176. used in WEEKLY.BAT. Not easy, but it can be done.
  177.    DAILY.BAT "Run a program only once a day" which you call call
  178. from your autoexec.bat relies on the MsDos external FC command. The
  179. output of this command has been rewritten in MsDos 5.0. DAILY.BAT
  180. did therefore not work for MsDos version 5.0.  I have consequently
  181. rewritten DAILY.BAT to comply also with the MsDos 5.0 version. A
  182. similar amendment has been done to VIRUS.BAT "Another batch-based
  183. virus test".
  184.    BOOT.BAT "Choose your boot configuration" now utilizes nu
  185. NOBOOT.EXE from garbo.uwasa.fi:/pc/ts/tstsr12.zip (or whichever is
  186. the current version number) if it is available. This is to prevent
  187. the user from accidentally being too hasty about rebooting while the
  188. batch is still running.
  189.    LASTBOOT.BAT "Show date + time of previous boot" streamlined to
  190. show just the date and time without the confusion of referring to
  191. the previous boot with "Current date is" which MsDos date (and time)
  192. produce.
  193.    PROMPT.TXT "Tips on prompt usages with ansi" has some additional
  194. information on key redefinitions.
  195.    BATRICKS.TXT added the following new items:
  196. 19. Utilizing the subst command in paths
  197. 20. How to run a batch once a week (testing for the weekday)
  198.    Some other, minor amendments.
  199.  
  200. Sun 30-Aug-1992: I have updated my collection of useful batch files
  201. and batch tricks. It is now garbo.uwasa.fi:/pc/ts/tsbat37.zip.
  202.    BATRICKS.TXT "Assorted batch tricks" now also explains how to
  203. extract the extension from a file name, how to prevent breaking a
  204. batch, how to avoid auxiliary batches, and much more.
  205.    PUSHDIRE.BAT "Non-resident push directory" has been totally
  206. rewritten and is now self-contained. The external auxiliary program
  207. SETPUSHD.EXE is no longer needed, and has been omitted from the
  208. collection. The companion program POPDIRE.BAT has been brought up to
  209. date. Both the batches can take an /s (show) switch. See the remarks
  210. within the batches for more information.
  211.    DELPATH.BAT "Delete a directory from the path" has been rewritten
  212. so that it creates the auxiliary file that it needs as a temporary
  213. file. Thus SETVAR.BAT is not longer needed in beforehand and has
  214. been eliminated from the collection.
  215.    UNPACK.BAT "Unpack-test-view any archivetype" does not need, nor
  216. allow an extension in the archive name because it know how to detect
  217. the type of the archive. The batch now first checks that the user
  218. has not mistakenly given an extension. UNPACK.BAT also treats the
  219. other error situations in a more informative manner than before.
  220.    D.BAT "Directory with sort & wildsearch" uses implicit wildcards
  221. to match anywhere in the file name(s). The batch now checks that the
  222. users soes not enter explicit wildcards to D.BAT.
  223.    LOCATE.BAT "Wildcard file find". Added an optional /p paging
  224. switch. Clarified the instructions.
  225.    WILD.BAT "Wilcard any command". Corrected the simple case of no
  226. command given to wild.bat to jump out.
  227.    ARC2ZIP.BAT "Single .arc to .zip with comment" has been rewritten
  228. to check more closely to correct input format. Likewise the renamed
  229. ZOO2ZIP.BAT and EXE2ZIP.BAT. ARC2ZIP.BAT is now harddisk oriented
  230. like the two others, since working on floppies can be now considered
  231. rare.
  232.    Some other minor changes and rewrites of the batches and their
  233. documentation. (The batches are self-documenting.)
  234.  
  235. Thu 6-Aug-92: I have updated my collection of useful batch files and
  236. batch tricks. It is now garbo.uwasa.fi:/pc/ts/tsbat36.zip. Among the
  237. updates and enhancements are
  238.    C.BAT "Lazy changing of a directory" has been enhanced. The basic
  239. idea is that if you are tired of typing the backslash (\), C.BAT
  240. lets you use an easier syntax.  For example if you have a directory
  241. on the current drive called \text\jokes\stupid you can apply the
  242. form "c text jokes stupid" without needing the backslash. If you
  243. type c alone, it takes you to the root directory. Now C.BAT can
  244. handle drives too, and at one go at that. For example of you are on
  245. the C: drive and your directory is on D: you can apply
  246.                 c d: text jokes stupid
  247. The beauty of the system is that the "d:" is optional, that is the
  248. batch can identify whether the first parameter indicates a drive or
  249. not.
  250.    BATRICKS.BAT is a new addition. It covers assorted batch tricks
  251. from the batches in the TSBAT collection, and also a number
  252. additional tricks that are not covered in the in the actual batches.
  253.    BOOT.BAT "Choose your boot configuration" now sounds a warning
  254. bell if you choose an non-existing boot configuration. My own
  255. selection new has four alternative boots, but you can easily adjust
  256. to yours. To logic is rather straight-forward. Also a couple of
  257. typos in the rem comments have been corrected.
  258.    PROMPT.TXT "Tips on prompt usages with ansi" has some new
  259. clarifications.
  260.    SCANZ.BAT "Scan for viruses (incl. execomp)" has been brought up
  261. to date.
  262.    VAASA.INF "Info: Finland, Vaasa, U of Vaasa, our faculty, Timo"
  263. has been updated. This file is included in most of my program
  264. packages.
  265.    There are several minor adjustments in some of the other items.
  266.  
  267. Tue 14-Apr-92: I have updated my collection of useful batch files
  268. and tricks making it garbo.uwasa.fi:/pc/ts/tsbat35.zip.
  269.    Sometimes there are situations where a batch file needs to call
  270. another in order to perform its task. There is a genuinely clever
  271. trick in Wolverton & Gooking, Supercharging MsDos, Microsoft Press,
  272. 1991, p. 102 to circumvent the need of having a separate batch by
  273. making a batch call itself. I have modified the solution a bit and
  274. rewritten my SAFEDEL.BAT (safe delete of files) so that it no longer
  275. needs the auxiliary SAFEDEL1.BAT batch.
  276.    Likewise the SHOW.BAT (wildcard multi-file type command) has been
  277. updated and the auxiliary file SHOW1.BAT has been deleted.
  278.    The same book shows how to push the current directory without the
  279. need of resident programs, auxiliary executables, or environment
  280. variables. On the other hand this is less general than my
  281. PUSHDIRE.BAT which uses an auxiliary executable and environment
  282. variables. PUSHIT.BAT based on the idea from Wolverton & Gooking
  283. does not work between different drives.  I have added this file to
  284. tsbat35.zip along with its auxiliary text file CD.AUX.
  285.  
  286. Sat 21-Mar-92: I have updated my collection of useful batch files
  287. and tricks making it garbo.uwasa.fi:/pc/ts/tsbat34.zip.
  288.  - Added EXE2ZIP for converting self-extracting archives into
  289.    zipped archives. Requires that you have PKZIP.EXE and dive R:
  290.    available. I have ramdisk on drive R:, and if you do not you have
  291.    to either customize the batch or use a suitable drive
  292.    substitution like SUBST R: C:\
  293.  - Updated REZIP.BAT which removes authenticity -AV labels for
  294.    zipped archives. (Such a batch is useful, since PKWare's
  295.    authenticity code was broken and some BBSes put in their own -AV
  296.    labels). If errors are reported by pkzip, the user is asked for
  297.    whether s/he wants to go on nevertheless.
  298.  - Added a WILD.BAT to perform wildcarded operations with commands
  299.    which ordinarily do not allow wildcards. Example of WILD.BAT
  300.    usage: WILD *.txt type. The idea for my own version comes a from
  301.    a note in a Finnish computer journal (Mikro PC, March 1992, Aimo
  302.    Matikainen).
  303.  
  304. Sat 22-Feb-92: I have updated my collection of useful batch files
  305. and tricks making it garbo.uwasa.fi:/pc/ts/tsbat33.zip.
  306.  - Added PROMPT.TXT tips on prompt usages with ansi
  307.  - Added REPLY.BAT to demonstrate how batch files can after all
  308.    accept input without any auxiliary programs (like the common
  309.    ask.exe). This is not a widely known trick, although I cannot
  310.    claim true originality. It utilizes environment variables, and is
  311.    somewhat awkward, but shows that it can be done.
  312.  
  313. Tue 4-Feb-92: I have again updated my collection of useful batch
  314. files. It is now garbo.uwasa.fi:/pc/ts/tsbat32.zip. Some of the
  315. batches do not allow wildcards in file names given to them as
  316. parameters. There was a clever for-loop trick in the PC Magazine Vol
  317. 11 No 1 on page 364 to check whether the file name is wildcarded.
  318. Even if innovative the PC Magazine's solution uses unnecessarily an
  319. environment variable for the checking. But the article got me
  320. thinking that I should find a better solution and put in a check for
  321. wildcards to warn the user in those of my batches which do not allow
  322. wildcards. Consequently I have updated the following batches in my
  323. collection:
  324.  ARC2ZIP.BAT     Single .arc to .zip with comment
  325.  REZIP.BAT       Remove zip authenticity labels
  326.  UNPACK.BAT      Unpack-test-view any archivetype
  327.  ZOO2ZIPH.BAT    Single .zoo to .zip on harddisk
  328.  
  329. Sat 25-Jan-92: I have updated my collection of useful batch files.
  330. It is now garbo.uwasa.fi:/pc/ts/tsbat31.zip and contains 49 batch
  331. files. It adds
  332. - boot.bat for convenient selective booting from alternative
  333.   configurations. It is often believed that complicated programs are
  334.   needed for booting with alternative configurations. The boot.bat
  335.   batch shows that this need not be the case at all.
  336. - path.txt to explain how to easily circumvent the 127 character
  337.   limit on the path length.
  338. - showtime.bat to show both the date and the time without the hassle
  339.   of beating enter to death.
  340. - mve.bat to move file(s) to another directory.
  341.  
  342. Sat 7-Dec-91: I have updated my collection of useful batch files. It
  343. is now garbo.uwasa.fi:/pc/ts/tsbat30.zip.
  344.    Alan Clark (clark@odie.ee.wits.ac.za) suggested that the screen
  345. blanking batches could well do with a method to totally hide the
  346. cursor while blanked. I have looked into this and noticed that this
  347. can be easily achieved without extra programs by using ansi escape
  348. sequences. BLK.BAT shows how to do it. (You'll have to activate
  349. cursor hiding by editing three rems away).
  350.    Added LC.BAT line count for text files.
  351.    Added TEST33.BAT Test for MsDos 3.3 or later, batch demo
  352.  
  353. Sat 9-Nov-91: I have updated my collection of useful batch files to
  354. be garbo.uwasa.fi:/pc/ts/tsbat29.arc. It includes PUSHDIRE.BAT,
  355. SETPUSHD.EXE, and POPDIRE.BAT for pushing and popping the current
  356. directory (utilizing environment variables).  I have added a /q
  357. switch for quiet operation (no echoing of the environment variables)
  358. at a suggestion from Doug Tooley, djtooley@lotus.uwaterloo.ca.
  359.    I have added a TESTANSI.BAT batch (with accompanying ISANSI.EXE)
  360. which can be used to test whether any ansi-type screen driver is
  361. installed and thus available.
  362.    There are also some minor adjustments in a couple of the old
  363. batches.
  364.    Get this package even if you do not need the individual batches.
  365. There is much to learn from them about MsDos and batch usages. Many
  366. Frequently Asked Questions (FAQs) are implicitly answered by looking
  367. at these files.
  368.  
  369. Sun 20-Oct-91: I have a collection of useful batch files which I
  370. have updated to be garbo.uwasa.fi:/pc/ts/tsbat28.arc.
  371.   I have added a LEVEL.BAT testbench batch for testing the error
  372. level returned by programs.
  373.   I have updated the ASK.EXE batch file enhancer. It now has the
  374. option to of returning with a timeout errorlevel. The usage of
  375. this enhancer is:
  376.  ASK [Prompt] [/b] [/d] [/l] [/t##] [/u]
  377.                 !    !    !    !      +- convert to Upper case
  378.                 !    !    !    +- Time-out parameter (0 = forever)
  379.                 !    !    +- convert to Lower case
  380.                 !    +- Direct read (no <-+ needed)
  381.                 +- Batch mode (needed only if no prompt)
  382.    I have added an ASKENV.EXE batch file enhancer to the collection.
  383. It is similar to ASK.EXE, but instead of returning an errorlevel
  384. value, it sets the (parent's) environment variable ASKENV value
  385. equal to the user's response.
  386.  
  387. Mon 9-Sep-91: I have updated my collection of useful batch files. It
  388. is now /pc/ts/tsbat27.arc.
  389.    Four of the batches in the package has been updated. Of these
  390. DAILY.BAT for running a program no more than one a day (eg from
  391. autoexec.bat) utilized ENTER.TXT to simulate pressing the enter key.
  392. This is no longer necessary but has been rewritten (with a trick
  393. with the echo command) in a way that no longer needs this separate
  394. file. My thanks to Ran Cheremsh CHERMESH%BGUVM.BITNET for reporting
  395. the problem.
  396.    SCANZ for scanning .ZIP files for viruses had a bug in the
  397. routine for scanning embedded .ZIPs.
  398.  
  399. Tue 9-Jul-91: I have updated my collection of useful batch files. It
  400. is now /pc/ts/tsbat26.arc.
  401.    Note that even if you don't perhaps need the same batches as I
  402. do, these batches may teach you many useful batch programming
  403. tricks which I have accumulated during my PC years.
  404.    Made a number of minor stylistic corrections.
  405.    Since someone cracked the pkzip 1.10 authenticity (-av) code some
  406. BBSes have been putting in their own ads as the authenticity labels.
  407. A new batch rezip.bat removes these labels, which may give the users
  408. a false sense of security.
  409.    Added a simple batch ruler.bat which shows the screen columns
  410. using ansi codes to avoid excessive scrolling.
  411.    I have my ramdisk on currently on drive R on my PCs which I use
  412. at home and at office.  For whatever it is worth I have updated the
  413. batches to reflect this change. Some of the batches require anyway
  414. that you edit the paths in them to reflect yours, so no added
  415. problem arise because of this.  And, if you have your own ramdisk,
  416. say, on d:, you can put the statement subst r: d:\ eg in your
  417. autoexec.bat file to avoid the need of editing just because we may
  418. happen to have ramdisks on different drives. (To be accurate there
  419. is no absolute need of your d: physically being a ramdisk. But it
  420. makes things a bit faster.)
  421.  
  422. Sun 12-May-91: I have updated my collection of useful batch files to
  423. be /pc/ts/tsbat25.arc.
  424.    One of the constant worries of downloaders of archived packages
  425. is the threat of viruses. (Games from shady BBSes are particularly
  426. susceptible, but even commercial products have been known to be
  427. infected). Fortunately there are good virus checkers like McAfee's
  428. /pc/virus/scanv77.zip and Fridrik Skulason's /pc/virus/fp-115a.zip
  429. available to check for infections. There are, however, two dilemmas
  430. in checking archived packages on a routine basis. (Since the format
  431. garbo.uwasa.fi archives mostly uses is .zip let's speak of zipped
  432. files). The first problem is that there are so many executable
  433. compressors in use currently (such as lzexe, pklite, diet, tinyprog,
  434. etc). This means that unless the virus checking programs can observe
  435. all these variations, a virus can be hiding in an execompressed
  436. form. Therefore it is advisable to expand the executables for the
  437. check. A second problem is that .zip files occasionally contain
  438. embedded .zip files (eg PC-Magazine's collections often do). These
  439. embedded .zip files must be unzipped for a closer examination.
  440.    The earlier versions of the tsbat collection included a batch
  441. called scanzip.bat. I have completely rewritten this batch to take
  442. care of the two eventualities discussed above. I have renamed the
  443. rewritten batch scanz.bat. Note that before using this new batch,
  444. you have to go through scanz.bat and edit all the directory path
  445. references to correspond to your own configuration. This is, of
  446. course, an inconvenience, but it is the best way of guaranteeing
  447. that a batch complicated as this stays reasonably efficient.
  448.  
  449. Wed 13-Mar-91: I have written a menu based ansi.sys driven advanced
  450. batch for sending command codes to the printer to make printer
  451. initialization and setting easy. It is called setprn.bat. It is for
  452. Diconix Inkjet Parallel Printer Model 150, which is an Espon
  453. compatible printer. Thus the batch is suitable for various different
  454. printer makes, and easily configurable. I have added this batch to
  455. my collection of (hopefully) useful and instructive batch files
  456. /pc/ts/tsbat24.arc best available by anonymous ftp from
  457. garbo.uwasa.fi archives. There is a program-based alternative to
  458. setprn.bat, that is setdico.exe which can be found in
  459. /pc/ts/tsprn##.arc. The difference is that in setprn.bat you are
  460. able to configure the printer codes if you wish.
  461.  
  462. Sat 29-Dec-90: I have programmed a fair number of MsDos batch files
  463. to make up a batch file collection of hopefully both useful and
  464. instructive batches. I have updated the collection to be version
  465. /pc/ts/tsbat23.arc by adding some new batches.
  466. ...
  467.    FU.BAT is a poor man's function evaluator utilizing gwbasic that
  468. (usually) belongs automatically to the MsDos delivery. The basic
  469. idea (pardon the pun) of combining batch and gwbasic programming is
  470. not really mine. I got it from the PC-Magazine. The code of this
  471. batch, however, is entirely due to yours truly.
  472. ...
  473.    ASK.EXE is a common batch file enhancer returning as errorlevel
  474. the ascii value of the first character of the user's response.
  475. An example of a simple batch utilizing ASK:
  476.     echo off
  477.     ASK Yes or no? /d /u
  478.     if errorlevel==89 if not errorlevel==90 echo It was a yes
  479.     if errorlevel==78 if not errorlevel==79 echo It was a no
  480.     echo on
  481. My ask has switches for lower case (/l) and upper case (/u)
  482. conversions, and (/d) "direct" reads without needing to press the
  483. enter key. The ask prompt may include escape sequences for ansi
  484. graphics. This is a feature not always available in other ask
  485. programs.
  486.    Ok, there are countless ask batch enhancers already around, so
  487. why yet another. Simply so that then tsbat23.arc has it, and you
  488. don't have to get one separately. Furthermore, this ask is both
  489. simple and general enough to be easy to use while being still
  490. flexible.
  491.    BTW, ask is the one command which the original MsDos batch
  492. programming most conspicuously lacks and needs. So many other
  493. seemingly lacking features are embedded in MsDos, and you just have
  494. to ferret them out. That's partly what tsbat23.arc collection is
  495. about.
  496. ...
  497.    SAFEDEL.BAT is a generalized batch for deleting files. It asks
  498. for confirmation for each file to be deleted. The usage is
  499.         SAFEDEL [FileName1] [FileNam2] ...
  500. and wildcards are allowed.
  501. ...
  502.    MENU.BAT show show to build menus for easy program selection by
  503. the user. This batch utilizes ask.exe, and is livened up by ansi
  504. graphics.
  505. ...
  506.    UNPACK.BAT has been updated. It extracts, tests, and views packed
  507. files (archives) irrespective of the packing method. The update
  508. handles also .arj files (the new arrival sent packing on the scene).
  509.  
  510. Mon 22-Oct-90: I have updated my batch file collection to be
  511. /pc/ts/tsbat22.arc. PC-Magazine Vol 9 Num 14 published a batch to
  512. com file compiler bat2exec.com by Douglas Boling which is in the
  513. /pc/pd2/bat2ex13.zip package at chyde.uwasa.fi archives. As would be
  514. expected a batch compiler is more stringent in its requirements than
  515. MsDos. Consequently I have gone through the batches in my collection
  516. and seen to it that they are compilable. Note that in doing this I
  517. have not altered the tasks of the batch files, nor have I included
  518. the resultant compiled .com files. Where needed, I have just
  519. adjusted the batches to conform with bat2exec.com compiler
  520. requirements.
  521.    Among others there is an addpath.bat batch for adding directories
  522. to the path without needing to rewrite the whole path as the
  523. ordinary path command would require. In a similar manner there is
  524. delpath.bat to omit a single directory from the path. Delpath.bat
  525. needs an auxiliary batch file called setvar.bat, which must be
  526. available to the delpath.bat. Delpath now checks whether the
  527. auxiliary setvar.bat file is available in the current directory or
  528. at path before running the rest of delpath.bat.
  529.    When a batch contains a call to a program, the program must
  530. either be in the current directory, at path, or the call must
  531. contain the path to the program. The last method has the
  532. disadvantage of requiring adaptation to user's own structure.
  533. Therefore the most general method is having the necessary program(s)
  534. at path. If the program is not available, a normal batch ends in a
  535. "Bad command or file name" error message. This gives very little
  536. information of the cause of the problem. Therefore I have added
  537. routines in the batches to precheck that the required program(s) are
  538. indeed at path, and if not, issue a proper error message telling
  539. what exactly is awry. (The batch trick here is testing whether a
  540. given file is at path.)
  541.    An additional note. Batches like delpath.bat cannot obviously be
  542. compiled successfully with bat2exec because of its need of an
  543. auxiliary batch. Another batch that works as a normal batch file,
  544. but won't work when compiled is color.bat. Color.bat sets the screen
  545. color attributes using ansi code. Bat2exec.exe compiler has similar
  546. problems with some other batches as well, but this does not affect
  547. the user of these batch files in any way.
  548.    I have added blk.bat as an alternative simple screen saver to
  549. complement blank.bat. Blk.bat stores the screen before blanking and
  550. pops it when you exit the saver.
  551.  
  552. Fri 13-Jul-90:  One of the operators at our computer centre asked me
  553. today whether I know a replacement utility for MsDos diskcopy to
  554. copy a 1.2Mb floppy to another without having to change the disks
  555. more than once. This is because MsDos diskcopy.com requires a total
  556. of five disk changes in the process, and besides this being tedious
  557. one easily gets things mixed up. If you look at things this way,
  558. scopy.bat in /pc/ts/tsbat21.arc does exactly what he was asking for,
  559. in a single step. But on the balance, you must have the target disk
  560. formatted before you begin the process (diskcopy does that for you,
  561. if necessary). This batch method works easily, though, only if the
  562. diskette to be copied has no subdirectories.
  563.  
  564. Sun 24-Jun-90: I have updated my batch file collection to be
  565. (/pc/ts)/tsbat21.arc. This time I have added my rendition of setting
  566. the screen text color and background. The color.bat batch uses ansi
  567. color codes. (Thus you must have loaded ansi.sys driver, or its
  568. enhanced equivalent (such as nansi.sys or zansi.sys). In other words
  569. your config.sys must have a line like device=\sys\zansi.sys in it).
  570.    Version tsbat20 introduced a scanzip.bat batch as a shell to scan
  571. .zip packages for viruses utilizing McAfee's scan.exe virus checker.
  572. In addition to unzipping the .zip files into a temporary directory
  573. the batch uncompressed lzexec .exe files, if any, using Alan
  574. Posner's (/pc/pd2) isl12.zip and Mitugu Kuriziono's
  575. (/pc/pd2/)unlzexe5.zip. With the introduction of version
  576. (/pc/virus/)scanv63.zip uncompression lzexed executables is no
  577. longer necessary, and I have adjusted the batch accordingly. I have,
  578. however, done this by just commenting away parts of the batch, so
  579. that you can still apply it if you have earlier than scan.exe
  580. version 63. I have also added checking overlay files in addition to
  581. .exe and .com files.
  582.    Please note that your email comments, feedback and suggestions on
  583. the ts-programs would be welcome. And if you want to look at other
  584. users' feedback, you can see it by getting /pc/pd2/post##.txt (## =
  585. 01, 02, and so on).
  586.  
  587. Thu 7-Jun-90: Lzexed files pose a problem for the present virus
  588. scanners. While waiting to see the announced scanv63 to appear with
  589. abilities to scan lzexe-compressed files, I wrote a batch to handle
  590. scanning .zip packages. This batch checks both ordinary and lzexed
  591. files within a .zip package. The following shareware and PD programs
  592. are needed: pkunzip.exe, scan.exe, islzexe.exe, unlzexe.exe, The
  593. packages containing these programs can be found from good BBSes and
  594. eg from chyde.uwasa.fi by anonymous ftp. The new batch scanzip.bat
  595. is included in the updated /pc/ts/tsbat20.arc batch file collection.
  596.  
  597. Fri 1-Jun-90: Released version /pc/ts/tsbat19.arc of my batch files
  598. collection. It includes two new batches. There is a poor man's
  599. screen save blank.bat, and there is an extension of the MsDos type
  600. command show.bat, which allows the usage of wildcards and multiple
  601. file names. You'll decide yourself if there is any usage for a
  602. wildcard type. Myself, I do not see any outright, but the batch
  603. itself is a very good exercise in batch programming. If you are new
  604. to this aspect of MsDos, I think you will learn many useful tricks
  605. from batches like this. - Where possible, I have tried to write the
  606. batches in a way that they need a minimum about of auxiliary files
  607. or such auxiliary programs, which are not part of MsDos (internal or
  608. external) commands. - I have rewritten lastboot.bat (recording the
  609. previous boot time of your PC) and logrun.bat (recording program
  610. usage) so that they no longer need the auxiliary files enter.txt and
  611. star.txt, which have been deleted from the new version. - There are
  612. some stylistic changes in scopy.bat.
  613.  
  614. Sat 17-Mar-90: Released a new version /pc/ts/tsbat18.arc of my batch
  615. files collection. - It seems that this batch collection has become
  616. perhaps the most popular of my packages judging from the recent
  617. download figures and the comments from users. (A note written later:
  618. The most downloaded package of mine is the Frequently Asked
  619. Questions /pc/ts/tsfaq##.arc, by a broad margin). - Corrected a
  620. small bug in c.bat that prevented going back to the root directory.
  621. - Built a simple batch lastboot.bat for displaying the date and time
  622. of the previous booting. - Also built a new batch virus.bat. This
  623. batch makes a directory both prior and after running the suspect
  624. program, and gives a warning if the directories differ, and prepares
  625. a list of the differences. The batch can be also used by a
  626. knowledgeable user for the more benevolent similar purpose of
  627. checking what files a certain programs changes.
  628.    *Flame off* One lesson to be learned from batch programming is
  629. that properly used MsDos can be quite flexible. I think it is here
  630. to stay for a long time yet Unix and OS/2 notwithstanding. And this
  631. does not mean castigating Unix nor OS/2. (Any discussion of this
  632. aspect to the proper newsgroups, if you please.) *Flame on* :-)
  633.  
  634. Sun 11-Mar-90: Released a new version /pc/ts/tsbat17.arc of my batch
  635. files collection. This update introduces a batch shell unpack.bat
  636. for extracting, testing, and viewing packed files irrespective of
  637. the packing method.
  638.  
  639. Sun 04-Mar-90: My batch file collection is now version (/pc/ts/)
  640. tsbat16.arc. - Addpath.bat appending new directories to the path now
  641. checks whether the directory exists, and whether the directory
  642. already is at path, thus preventing mistakes by the user. I use this
  643. batch myself a lot, and since I often make typing errors, I wanted
  644. the batch to do the validity checking for me. - Arc2zip.bat
  645. converting an .arc file to a .zip file, with comment, has added
  646. safeguards against errors and corrupted archives. - Deldir.bat for
  647. deleting the files from a directory and then removing the directory,
  648. has been rewritten. - There are also new batches in the collection.
  649. - There is a harddisk version of the packing methods converter
  650. called zoo2arch.bat. It is a .zoo to .zip converter eg for those who
  651. prefer tighter .zip files over the binary posting's current .zoo
  652. packing method. - If you have been annoyed by the fact that MsDos
  653. cannot take more than one command per command line, m.bat is the
  654. batch for you. It is a batch that facilitates giving multiple MsDos
  655. commands. Another new batch is d.bat. It gives the directory with
  656. sort and generalized name matching. - Also managed to resist the
  657. temptation to rename the documentation to the obvious bat.man.
  658.  
  659. Thu 25-Jan-90: I have updated my batch file collection to be version
  660. (/pc/ts/)tsbat15.arc.  There is just one addition, daily.bat. It is
  661. intended to run a program from the autoexec.bat file only once in a
  662. day.  There are programs in circulation, which achieve the same
  663. thing as daily.bat.  The trick in daily.bat is that it is a true
  664. batch file without the need of any external user-made programs.
  665. This not a very difficult to do, but tricky enough to be
  666. interesting and educational.
  667.  
  668. Tue 16-Jan-90: I have still been thinking about batch files and
  669. interesting tricks to do with them, and I therefore publish a new
  670. upgrade of my botch :-) collection in a rapid succession after the
  671. last update. The upgrade is (/pc/ts/)tsbat14.arc, and it will be
  672. available by anonymous ftp at least from chyde.uwasa.fi, Simtel20,
  673. and by BBS download or file request from Micro Maniacs Opus 2:515/1
  674. telephone 358-0-425966. Two new utilities are included. The first is
  675. delpath.bat, which removes a directory from the path variable. This
  676. was a really tricky one, and my solution (contrary to the other
  677. batches in the collection) requires MsDos version 3.30 because it
  678. uses the call command. I have since seen another solution in the
  679. PC-Magazine (Vol 8 No 21) but mine uses a somewhat different
  680. technique, and should be clearer because even I can understand how
  681. mine works :-). The second new batch is deldir.bat for deleting the
  682. files from a directory and then removing the directory. This is
  683. really trivial, but I needed it myself. I have tried to include
  684. reasonable number of safeguards within this batch.
  685.  
  686. Sun 14-Jan-90: I have updated my batch file collection to be version
  687. (/pc/ts/)tsbat13.arc.
  688.    There is a new batch arc2zip.bat for converting an .arc file to a
  689. corresponding .zip file. The batch automatically adds your zip-file
  690. comment to the converted .zip. Also, the date of the zip file is
  691. automatically set to the date of the latest file within the .zip,
  692. not the date of the conversion.
  693.    Another new batch is zipdate. It demonstrates how to datestamp
  694. .zip packages.
  695.    The new version also includes a second addpath utility. It is
  696. apath-om.bat and is by Otto Makela. It is included in my batch file
  697. collection with Otto's explicit permission. Thanks Otto. This batch
  698. nicely demonstrates testing a condition (is a directory already in
  699. the path) in MsDos batch programming. I had an interesting time
  700. testing Otto's batch and discussing the dilemmas in the earlier
  701. versions after Otto posted the original version in the news in
  702. alt.msdos.programmer. I think that we both gained in the process. I
  703. would pleased to consider similar useful contributions from other
  704. users, as well. If you are interested, contact me by email.
  705.    Where.bat has been rewritten. It finds a file by using a search
  706. string on the file name. Contrary to the ordinary wildcarded MsDos
  707. DIR-type convention, where.bat matches the search string anywhere
  708. within the body of the file name. The updated where.bat has been
  709. made case-insensitive (applies upper case conversion on batch
  710. parameters).
  711.    Some of the other batches in the package have had their help
  712. texts extended.
  713.  
  714. Sat 18-Nov-89: There are several nice memory resident push/pop
  715. directory utilities around. As you know pushdir stores the name of
  716. the directory where you are. You can then change the directory (and
  717. the drive) as much as you like, and popdir takes you right back to
  718. the original directory. But memory resident programs tend to pile
  719. up, and I started thinking whether push/pop can be achieved using
  720. non-resident batch methods. PUSHDIRE.BAT and POPDIRE.BAT together
  721. with SETPUSHD.EXE do this by juggling the environment variables. I
  722. pushed these files in my batch file collection and updated it to be
  723. tsbat12.arc. You can pop them from there.
  724.  
  725. Tue 31-Oct-89: Released update /pc/ts/tsbat11.arc of my batch files
  726. collection. The new release introduces LOGRUN.BAT. It can be used
  727. for calling programs and logging the call in a usage log with
  728. time/date information. The batch utilizes MsDos time and date
  729. commands for making the usage log of the program calls. The bug
  730. caused by the non-standard switch /i in the file finder WHERE.BAT
  731. has been amended. A new batch LOCATE.BAT for locating a file (or
  732. files) on a disk has been added. Contrary to WHERE.BAT it is not
  733. case sensitive. The "change the directory" batch has been renamed
  734. C.BAT (was SD.BAT). I have also added more comments within some of
  735. the batches.
  736.   If you get an "Out of environment space" message in these, or any
  737. other batches, try increasing your environment space by using shell
  738. configuration in config.sys:
  739.      Example: shell=c:\bin\command.com c:\bin /e:1024 /p
  740.  
  741. Sun 29-Oct-89: I decided to introduce a batch file collection
  742. /pc/ts/tsbat10.arc.  The batches are quite straightforward, and do
  743. not need any special auxiliary programs, just the ordinary MsDos
  744. commands.  Some of the batches are from my other utility packages,
  745. some are new.  I do not claim a high degree of originality.  This is
  746. because the methods and tasks of batch programming keep repeating
  747. over and over again.  But I hope that you will find some of my
  748. tricks useful.
  749.   And if you feel that you have useful batches yourself, which you
  750. would like to distribute to your fellow users, I would be interested
  751. in considering any good ideas for development.  Due credit would
  752. naturally be given.  I would, however, reserve the right to choose,
  753. and to develop your batches to suit the future versions of this
  754. Public Domain collection.
  755.  
  756. Thu 26-Oct-89: I have a private mailing list for emailing these
  757. update news. Especially, if you have my programs downloadable at
  758. your site or your BBS you are welcome to ask for inclusion on this
  759. list by emailing to me at ts@chyde.uwasa.fi.
  760.